home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / Mesa-1.2.1 / include / GL / glx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-05  |  4.1 KB  |  203 lines

  1. /* glx.h */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25. $Id: glx.h,v 1.7 1995/05/22 17:03:21 brianp Exp $
  26.  
  27. $Log: glx.h,v $
  28.  * Revision 1.7  1995/05/22  17:03:21  brianp
  29.  * Release 1.2
  30.  *
  31.  * Revision 1.6  1995/04/28  20:04:36  brianp
  32.  * rename GLX_BAD_ATTRIB to GLX_BAD_ATTRIBUTE
  33.  *
  34.  * Revision 1.5  1995/04/17  14:42:00  brianp
  35.  * added GLX version 1.1 functions and symbols
  36.  *
  37.  * Revision 1.4  1995/04/05  18:29:41  brianp
  38.  * added GLX error constants
  39.  *
  40.  * Revision 1.3  1995/03/04  19:45:47  brianp
  41.  * 1.1 beta revision
  42.  *
  43.  * Revision 1.2  1995/02/28  21:22:39  brianp
  44.  * fixed a typo
  45.  *
  46.  * Revision 1.1  1995/02/28  21:21:03  brianp
  47.  * Initial revision
  48.  *
  49.  */
  50.  
  51.  
  52. #ifndef GLX_H
  53. #define GLX_H
  54.  
  55.  
  56. /*
  57.  * A pseudo-GLX implementation to allow GLX-based OpenGL programs to
  58.  * work with Mesa.
  59.  * Initial version contributed by Philip Brown (philb@CSUA.Berkeley.EDU).
  60.  */
  61.  
  62.  
  63.  
  64. #include <X11/Xlib.h>
  65. #include <X11/Xutil.h>
  66. #include "GL/xmesa.h"
  67.  
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72.  
  73.  
  74. #define GLX_VERSION_1_1    1
  75.  
  76.  
  77. /*
  78.  * Tokens for glXChooseVisual and glXGetConfig:
  79.  */
  80. enum _GLX_CONFIGS {
  81.     GLX_USE_GL = 1,
  82.     GLX_BUFFER_SIZE,
  83.     GLX_LEVEL,
  84.     GLX_RGBA,
  85.     GLX_DOUBLEBUFFER, 
  86.     GLX_STEREO,
  87.     GLX_AUX_BUFFERS,
  88.     GLX_RED_SIZE,
  89.     GLX_GREEN_SIZE,
  90.     GLX_BLUE_SIZE,
  91.     GLX_ALPHA_SIZE,
  92.     GLX_DEPTH_SIZE,
  93.     GLX_STENCIL_SIZE,
  94.     GLX_ACCUM_RED_SIZE,
  95.     GLX_ACCUM_GREEN_SIZE,
  96.     GLX_ACCUM_BLUE_SIZE,
  97.     GLX_ACCUM_ALPHA_SIZE,
  98.     GLX_SAMPLES_SGIS,        /* SGI extension */
  99.     GLX_SAMPLE_BUFFER_SGIS        /* SGI extension */
  100. };
  101.  
  102.  
  103. /*
  104.  * Error codes returned by glXGetConfig:
  105.  */
  106. #define GLX_BAD_ATTRIBUTE    1
  107. #define GLX_BAD_CONTEXT        2
  108. #define GLX_BAD_ENUM        3
  109. #define GLX_BAD_SCREEN        4
  110. #define GLX_BAD_VALUE           5
  111. #define GLX_BAD_VISUAL        6
  112. #define GLX_NO_EXTENSION    7
  113.  
  114.  
  115.  
  116. /*
  117.  * New in GLX 1.1:
  118.  */
  119. #define GLX_EXTENSIONS     1
  120. #define GLX_VENDOR    2
  121. #define GLX_VERSION    3
  122.  
  123.  
  124.  
  125. typedef XMesaContext GLXContext;
  126.  
  127. typedef Pixmap GLXPixmap;
  128.  
  129. typedef Drawable GLXDrawable;
  130.  
  131.  
  132.  
  133. extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
  134.                      int *attribList );
  135.  
  136. extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
  137.                     GLXContext shareList, Bool direct );
  138.  
  139.  
  140. extern void glXDestroyContext( Display *dpy, GLXContext ctx );
  141.  
  142.  
  143. extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
  144.                 GLXContext ctx);
  145.  
  146.  
  147. extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
  148.                 GLuint mask );
  149.  
  150.  
  151. extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
  152.  
  153.  
  154. extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
  155.                      Pixmap pixmap );
  156.  
  157.  
  158. extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
  159.  
  160.  
  161. extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
  162.  
  163.  
  164. extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
  165.  
  166.  
  167. extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
  168.  
  169.  
  170. extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
  171.              int attrib, int *value );
  172.  
  173.  
  174. extern GLXContext glXGetCurrentContext( void );
  175.  
  176.  
  177. extern GLXDrawable glXGetCurrentDrawable( void );
  178.  
  179.  
  180. extern void glXWaitGL( void );
  181.  
  182.  
  183. extern void glXWaitX( void );
  184.  
  185.  
  186. extern void glXUseXFont( Font font, int first, int count, int list );
  187.  
  188.  
  189. /* New in GLX version 1.1 */
  190. extern const char *glXQueryExtensionsString( Display *dpy, int screen );
  191.  
  192. extern const char *glXQueryServerString( Display *dpy, int screen, int name );
  193.  
  194. extern const char *glXGetClientString( Display *dpy, int name );
  195.  
  196.  
  197.  
  198. #ifdef __cplusplus
  199. }
  200. #endif
  201.  
  202. #endif
  203.